chore(deps): replace pre-commit with prek and remove husky#10601
chore(deps): replace pre-commit with prek and remove husky#10601
Conversation
Swap the Python-based pre-commit framework for prek, a Rust-based
drop-in replacement that is significantly faster. Prek reads the
same .pre-commit-config.yaml format natively.
Replace pre-commit commands with prek in the Python development setup section.
Update the hooks setup section heading and description to reference prek instead of pre-commit.
Replace pre-commit references with prek in the hooks setup section and add a warning note about using --overwrite flag when migrating from pre-commit.
|
Please add an entry to the corresponding |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
|
✅ Conflict Markers Resolved All conflict markers have been successfully resolved in this pull request. |
🔒 Container Security ScanImage: 📊 Vulnerability Summary
4 package(s) affected
|
Remove husky and lint-staged npm packages since prek now manages git hooks at the repository level. The ui/.husky/pre-commit script is a standalone bash script that prek invokes directly via the ui-checks hook in .pre-commit-config.yaml.
Detect prek from PATH first (brew, npm global, pipx), then fall back to Poetry. This allows UI-only contributors to use prek without needing Poetry installed.
Rename detection function to isPrekInstalled and update log messages. Also detects legacy pre-commit hooks for backwards compatibility.
Update troubleshooting instructions to use prek commands and remove references to the pre-commit Python tool in code review documentation.
Poetry must be preferred over standalone prek because local hooks (pylint, bandit, safety, vulture, trufflehog) are Python dev dependencies installed via Poetry. When only standalone prek is available, warn that these hooks will fail without the deps.
🔒 Container Security ScanImage: ✅ No Vulnerabilities DetectedThe container image passed all security checks. No known CVEs were found.📋 Resources:
|
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## master #10601 +/- ##
==========================================
- Coverage 93.55% 84.16% -9.40%
==========================================
Files 225 1668 +1443
Lines 31652 53463 +21811
==========================================
+ Hits 29613 44995 +15382
- Misses 2039 8468 +6429 Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
jfagoagas
left a comment
There was a problem hiding this comment.
Great work @puchy22 @alejandrobailo 👏
|
Nice cleanup! Consolidating hooks under prek makes a lot of sense for the monorepo. One thing I'd double-check: the README removed the Safety installation instructions, but if it's still a hook in .pre-commit-config.yaml, new contributors might get confused when it fails. Other than that, looks solid 👍 |
Context
Replace the Python-based
pre-commitframework with prek, a Rust-based drop-in replacement that is significantly faster. Prek reads the same.pre-commit-config.yamlformat natively, so no hook configuration changes are needed.Also removes the
huskyandlint-stagednpm dependencies from the UI, since prek now manages hooks at the repository level. Theui/.husky/pre-commitscript is a standalone bash script that prek invokes directly via theui-checkshook in.pre-commit-config.yaml.Description
SDK/Root:
pre-commitPython dependency forprekinpyproject.tomlscripts/setup-git-hooks.shto detect prek — prefers Poetry (needed for system hooks like pylint, bandit, safety, vulture, trufflehog), falls back to standalone prek with a warning about missing Python toolsprek install --overwritefor existing pre-commit usersUI:
huskyandlint-stagedfromdevDependenciesand thepreparescriptui/scripts/setup-git-hooks.jsto detect prek hooksDocumentation:
AGENTS.md,README.md, developer guide, security docs, and UI docsSteps to review
.pre-commit-config.yamlis unchanged (prek reads it natively)poetry install --with dev && poetry run prek install --overwriteto confirm installationpoetry run prek run --all-filesto confirm all hooks execute correctlyui/, runpnpm installto verify it works without huskyChecklist
SDK/CLI
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.